//
//  KAHomeInfo.swift
//  kano
//
//  Created by Frank on 2024/9/11.
//

import KakaJSON

struct KAAuditState: Convertible, Codable {
    var businessStatus: Int = 0
    var userAccountFlag: Int = 0
    var currentDateTime: Int = 0
    //auditState 是否已授信: 1或true，已授信
    var auditCondition: Int = 0

    var forwardingFee: String = ""
    var availableBalanceList: String = ""
    var renewalCharge: String = ""
    var creditStatusNormal: String = ""
    var largeSubCreditCheckDuration: String = ""
    var latestCreditCheckTime: String = ""
    var loanEligibility: String = ""
    var businessClassification: String = ""
    var isExtendedSubCreditEligible: String = ""
}


struct KAHomeInfo: Convertible {
    var repaymentState: Bool = false
    //firstAuthFlag: 1、用户首次授信成功(AF上报用)
    var marketPromotion: Int = 0
    //firstGetQuotaFlag: 1、第一次获取配额标志(AF上报用)
    var actionButtonStyle: Int = 0
    //loanBillList 贷款账单列表
    var voucherConfigurationId: [KALoanBillList]? 
    var verificationToken: [KAProductInfo]?
    var liquidationStatus: Bool = false
    var targetAudienceId: Int = 0
    var businessStatus: Int = 0
    // isSubLogic 1:大额
    var subLogicIndicator: Int = 0
    var smsNotificationStatus: Int = 0
    var deviceBindingIndicator: Int = 0
    var overdueRateFirstDay: Bool = false
    var commentText: Bool = false
    var developmentDataValidity: Bool = false
    //borrowingLoanType: 0:无在借订单  1:短贷  2:大额分期（蝌蚪贷属于小额，这里不影响）
    var loanTypeForBorrowing: Int = 0
    var responseResourceURL: Bool = false
    var forwardingQuantity: Bool = false
}

// MARK: - ProductInfo
struct KAProductInfo: Convertible, Codable {
    //productType 产品类型：1、14天小额 2、大额
    var productClassification: Int = 0
    //creditLine 授信额度: 0:未授信，其他可借款
    var loanInterestPercentage: Double = 0.00
    //可借金额
    var borrowingCapacity: Double = 0.00
    var verificationNumberCheck: Double = 0.00
    var refusalIndicator: [KAProductDetail]?
}

// MARK: - ProductInfoDetail
struct KAProductDetail: Convertible, Codable {
    var relatedTypeIdentifier: Double = 0.00
    var newPassphrase: Int = 0
    var repaymentstatenum: String = ""
    var productDuration: String = ""
    var installmentCycleNumber: Int = 0
    var userDisplayName: Int = 0
    var costReductionOutcome: Int = 0
}


struct KALoanBillList: Convertible {
    var voucherSequenceNumber: String = ""
    var guaranteeCardTransactionId: String = ""
    var withdrawalCardIdentifier: String = ""
    var registrationConfirmation: Int = 0
    var overdueStatus: Int = 0
    var validationCode: Int = 0
    var emailProvider: Int = 0
    var dueDateTime: TimeInterval = 0
    var initialCreationTime: Bool = false
    var productDetailsList: Bool = false
    var responseContent: Int = 0
    var maximumLoanLimit: Int = 0
    //exceedDays 过期几天
    var overdueDuration: Int = 0
    var cachingRequirementFlag: Int = 0
    var geetestSecurityCode: Int = 0
    var installmentCycleNumber: Int = 0
    var orderSequenceNumber: String = ""
    var feeReductionApplicationTime: Int = 0
    var businessProcessType: Int = 0
    var renewalDeadline: Int = 0
}





//MARK: - Banner
struct KAHomeBanner: Convertible, Codable {
    var cumulativeUserCount: Int = 0
    var primaryImageGallery: [KAHomeBannerImg]?
    var systemCapabilityList: [KAHomeBannerFunc]?
}

struct KAHomeBannerImg: Convertible, Codable {
    //title
    var userTransactionIdentifier: String = ""
    //img
    var withdrawalSum: String = ""
    //target
    var navigationURL: String = ""
    var entityIdentifier: Int = 0
    var operationGuidelines: TimeInterval = 0
    var modificationTimestamp: TimeInterval = 0
    var authToken: TimeInterval = 0
    var displayTerminationTime: TimeInterval = 0
    var displaystatus: Int = 0
    var transactionPasswordSet: Int = 0
    var refundStatus: String = ""
    var clickableInterfaceStatus: Int = 0
    var requestChannel: Int = 0
    var businessStatus: Int = 0
    var presentationOrder: String = ""
}
struct KAHomeBannerFunc: Convertible, Codable {

}



//MARK: - News

struct KAHomeNewsContent: Convertible, Codable {
    var totalVolume: Int = 0
    var entityIdentifier: Int = 0
    var operationGuidelines: TimeInterval = 0
    var modificationTimestamp: TimeInterval = 0
    var loanOccupationStatus: Int = 0
    var userAccountFlag: Int = 0
    var requestChannel: String = ""
    var loanSum: String = ""
    var userTransactionIdentifier: String = ""
    var voucherQuantity: String = ""
    var borrowingLimit: Int = 0
    var passwordStrengthType: Int = 0
    var imageResourceURL: String = ""
    //"/index":首页  "/lendInfo":借款  "/risk":授信  "/bill":账单  "/invitefriends_new":邀请好友
    var extendedResourceLocator: String = ""
    var recipientDisplayName: Bool = false
    var titlePresentation: TimeInterval = 0
    var loanRecordIdentifier: TimeInterval = 0
    var refundStatus: String = ""
    var questionnaireDisplay: Int = 0
    var originSource: String = ""
    var presentationOrder: String = ""
    var interestRates: String = ""
    var relationImportIdentifier: String = ""
}
struct KAHomeNews: Convertible, Codable {
    //公告类型
    var newsCategory: Int = 0
    //公告集合
    var dailyInterestCharge: [KAHomeNewsContent]?
    //营销公告
    var renewalCapability: [KAHomeNewsContent]?
    var homepagePresentationGuide: String = ""
    var statusPageGuide: String = ""
    var redirectionLink: String = ""
    var voucherMonetaryValue: String = ""
    var sourceIdentifier: String = ""
    var sharedActivityStatus: Bool = false
}

//MARK: - 优惠券
struct KAHomeCoupon: Convertible, Codable {

    var entityIdentifier: Int = 0
    var uniqueIdentifier: String = ""
    var bankPrefixName: Bool = false

    var transferCapability: String = ""
    var voucherMonetaryValue: Double = 0.00
    
    var popupNotification: Int = 0
    var withdrawalAccountDetails: TimeInterval = 0
    var relationType: Int = 0
    var conditionMaximumBoundary: Int = 0
    var eligibilityThreshold: Int = 0
    //0,单期券 1 分期券 4 通用券
    var voucherTransactionMethod: Int = 0
    var feedbackTimestamp: Int = 0
}
